package cn.bdqn.utils;

import cn.bdqn.exception.JxcException;
import cn.bdqn.vo.ResultVo;

/**
 * @author 郑大仙丶
 * @date 2018-12-28 17:13
 */
public class ResultVoUtil {
    public static ResultVo success(Object data){
        ResultVo vo = new ResultVo();
        vo.setCode(200);
        vo.setMessage("成功");
        vo.setData(data);
        return vo;
    }


    public static ResultVo success(){
        return ResultVoUtil.success(null);
    }

    public static ResultVo error(JxcException ex){
        ResultVo vo = new ResultVo();
        vo.setCode(ex.getCode());
        vo.setMessage(ex.getMessage());
        return vo;
    }


}
